<?php

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Route;



Route::prefix('apicrzs') ->group(function() {
    Route::get('testYvan', 'Public\TestControllers@test_yvan');//测试地址
//    Route::get('testYvan', 'Public\TestControllers@getVersion');//测试地址
    Route::get('junda', 'PublicController@junda');
    Route::get('basic_config', 'PublicController@getMallBasicConfig');
    Route::get('get_agreement', 'PublicController@getAgreementType');
    Route::get('getFileSign', 'UploadController@getFileSign');
    Route::get('getWxSign', 'Wechat\AuthController@getWxGzhSign');
    //  api/apicrzs/wx/callback
    Route::prefix('wx')->group(function() {
        Route::match(['GET','POST'],'callback/{type}', 'Thirdparty\WxPayController@getFileSign');
    });

    //支付回调
    Route::prefix('pay')->group(function () {
        Route::match(['GET','POST'],'notify/{type}', 'PayController@notify');
    });

    //notify/callback/recharge
    Route::prefix('notify')->group(function () {
        //骏达 刷卡通知
        Route::match(['GET','POST'],'notify', 'PayController@notify');
        Route::match(['GET','POST'],'callback', 'Wechat\PayNotifyControllers@getJundaCallback');
        // 微信 支付宝  回调
        Route::match(['GET','POST'],'callback/consume', 'Wechat\PayNotifyControllers@notifyWxConsume');
        Route::match(['GET','POST'],'callback/recharge', 'Wechat\PayNotifyControllers@notifyRecharge');
        Route::match(['GET','POST'],'callback/alipay', 'Wechat\PayNotifyControllers@notifyAlipay');
        Route::post('callback/refund', 'Wechat\PayNotifyControllers@pay_refunds');
        Route::post('yvan', 'Wechat\PayNotifyControllers@pay_yvan');
    });





    //  api/apicrzs/aliyun/callback
    Route::prefix('aliyun')->group(function() {
        Route::get('callback', 'Thirdparty\AliyunOssController@getFileSign');
    });

    Route::prefix('gq')->group(function () {
        Route::get('source', 'Public\EquipmentController@getSource');// 来源
        Route::get('alipay', 'Public\EquipmentController@getAlipaySource');// 来源
    });
    //扫码订单
    Route::prefix('pay')->group(function () {
        Route::get('recharge', 'Intake\PayRechargeController@createConsumeOrder');// 来源
    });
    Route::prefix('intake')->group(function () {
        // 扫码取水 生成订单

        // 扫码取水 生成订单
        Route::prefix('order')->group(function () {
            Route::post('/create', 'Intake\WaterOrderController@createScanStart'); //生成订单 02
            Route::post('/payment', 'Intake\WaterOrderController@paymentOrder'); // 微信支付 03
            Route::post('/cancel', 'Intake\WaterOrderController@paymentOrderCancel'); // 微信支付取消
            Route::post('/start', 'Intake\WaterOrderController@getScanStart'); // 开始取水
            Route::post('/cardstart', 'Intake\WaterOrderController@getScancardStart'); //
            Route::post('/getICConsume', 'Intake\WaterOrderController@getScanConsumeStart'); // IC 卡 开始取水
        });
        Route::prefix('device')->group(function () {
            Route::get('/online', 'Intake\DeviceController@getIsOnline'); // 检测设备状态 01
            Route::get('/list', 'Intake\DeviceController@lists'); // 设备列表 + 地图
            Route::get('/getEquipmentPlan', 'Intake\DeviceController@getEquipmentPlan'); // 设备列表 + 地图
            Route::post('/start', 'Intake\WaterOrderController@getScanStart'); // 扫码启动
        });
    });



    //

    Route::prefix('auth')->group(function() {
        Route::post('login', 'LoginController@login');
        Route::post('alilogin', 'AlipayLoginControllers@silenceAuth');// 支付宝 用户信息
        Route::post('verifykey', 'LoginController@verifyKey');//获取发短信的key
        Route::post('verifycode', 'LoginController@verifyGetCode');//获取发短信的key
        Route::post('register', 'LoginController@register');//注册
        Route::post('retrieve', 'LoginController@retrieve');//注册
        Route::prefix('register')->group(function() {
            Route::post('reset', 'LoginController@resetLogin');//注册
            Route::post('verify', 'LoginController@registerVerify');//注册
            Route::post('register', 'LoginController@registerVerify');//注册
        });

        Route::prefix('alipay')->group(function() {
            Route::get('login', 'Auth\AlipayAuthControllers@silenceAuth');//注册
            Route::get('callback', 'Auth\AlipayAuthControllers@handleCallback');//注册
        });
    });

});
